package org.jaaksi.umeng.updata;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import com.umeng.update.UmengUpdateAgent;

public class MyActivity extends Activity {
    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        initUmengUpdata(this);
    }

    public void initUmengUpdata(Context context) {
        // 默认仅wifi下才自动更新
        UmengUpdateAgent.setUpdateOnlyWifi(false);
        UmengUpdateAgent.update(context);
    }

    public void update(View view) {
        // 手动更新
        UmengUpdateAgent.forceUpdate(this);
    }
}
